/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-08-22 13:27:13
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-08-22 13:27:58
 * @FilePath: \ruoyi-ui\src\api\wechat\material.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

export function getPage(query) {
    return request({
        url: '/wechat/wxMaterial/image/page',
        method: 'get',
        params: query
    })
}
/**上传非图文微信素材 */
export function materialFileUpload(obj) {
    return request({
        url: '/wechat/wxMaterial/materialFileUpload',
        method: 'put',
        data: obj
    })
}
export function addObj(obj) {
    return request({
        url: '/wxmaterial/materialNews',
        method: 'post',
        data: obj
    })
}

export function materialNewsUpdate(obj) {
    return request({
        url: '/wxmaterial/materialNews',
        method: 'put',
        data: obj
    })
}

export function getObj(id) {
    return request({
        url: '/wxmaterial/' + id,
        method: 'get'
    })
}

export function delObj(query) {
    return request({
        url: '/wxmaterial',
        method: 'delete',
        params: query
    })
}

export function putObj(obj) {
    return request({
        url: '/wxmaterial',
        method: 'put',
        data: obj
    })
}

export function getMaterialOther(query) {
    return request({
        url: '/wxmaterial/materialOther',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}

export function getMaterialVideo(query) {
    return request({
        url: '/wxmaterial/materialVideo',
        method: 'get',
        params: query
    })
}

export function getTempMaterialOther(query) {
    return request({
        url: '/wxmaterial/tempMaterialOther',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}